#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:Single02.py
@time:2021/09/17
"""
import socketserver
name = 'zhangsan'
age = 21

# class PersonMeta(type):
#     ...
#     def __init__(self,class_name,class_parents,class_dict):
#         """
#
#         self -> Person 类
#
#         """
#         super().__init__(class_name,class_parents,class_dict)
#         self.__instance = self(name,age)
#
#
#     def __call__(self, *args, **kwargs):
#         """
#         这里的self也是 Person 类
#         实例对象在类初始化的时候已创建，保存在 类的 __instance 属性中
#         现在只需要初始化即可
#         """
#         # self.__init__(self.__instance, *args, **kwargs)
#         return self.__instance
#
#
#
# class Person(metaclass=PersonMeta):
#     ...
#     def __init__(self,name,age):
#         self.name = name
#         self.age = age


def cal_time(title):

    def outWrapper(func):
        ...
        def innerWrapper(*args, **kwargs):
            ...
            import time
            start = time.time()
            result = func(*args, **kwargs)
            print(f'{title},time:{time.time() - start}')
            return result
        return innerWrapper
    return outWrapper


@cal_time('my')
def test01():
    ...
    import time
    time.sleep(2)


if __name__ == '__main__':
    pass
    # test01()
    t = (1, 2, [30, 40])
    try:
        # t[2] += [50, 60]
        t[2] = t[2] + [50,60]
        t[2].extend([50,60])
        pass
    except Exception as e:
        ...


    # t[2].append([50,60])
    t[2].extend([50,60])
    # print(t)
    print(t)

    t1 = [1,2,3]
    print(id(t1),t1)
    t1 += [4,5]
    print(id(t1),t1)
